/*
 *  Copyright (C) 2011 felixtheripper <felixtheripper_AT_gmail.com>
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version 2
 *  of the License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

/**
 *
 * @author felixtheripper
 *
 * email: felixtheripper_AT_gmail.com
 * ... please remove "_AT_" from the above string to get the right email address
 *
 */


package org.myorg.ctm.etk.gui.swg.display.border;

import java.awt.Color;
import java.awt.Font;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.border.BevelBorder;
import javax.swing.border.Border;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.EtchedBorder;
import javax.swing.border.TitledBorder;

/**
 *
 * 
 */

public class EtkBorder
{
    
    // -------------
    // STATIC PUBLIC


    static public void s_set(JPanel pnl, String strTitle)
    {
    	EtkBorder._s_set(pnl, strTitle, EtkBorder._FNT_TITLE);
    }

    // deeper
    static public void s_setLevel2(JPanel pnl, String strTitle)
    {
    	EtkBorder._s_set(pnl, strTitle, EtkBorder._FNT_TITLE_LEVEL2);
    }

    static private void _s_set(JPanel pnl, String strTitle, Font fnt)
    {
        Border brdTitle = new TitledBorder(null, strTitle,
	        TitledBorder.LEFT, TitledBorder.TOP, fnt, new Color(80, 40, 40));

	    Border brdCompound = new CompoundBorder(brdTitle, EtkBorder._BRD_EMPTY5);
	    pnl.setBorder(brdCompound);
    }

    //

    static public void s_setRaised(JPanel pnl)
    {

        Border raisedbevel = BorderFactory.createRaisedBevelBorder();

	    //Border brdCompound = new CompoundBorder(_f_s_brdEtched, _f_s_brdEmpty5);
	    pnl.setBorder(raisedbevel);
    }

    static public void s_setEtched(JPanel pnl)
    {

	    Border brdCompound = new CompoundBorder(_BRD_ETCHED, _BRD_EMPTY5);
	    pnl.setBorder(brdCompound);
    }

    static public void s_setEmpty(JPanel pnl)
    {

        pnl.setBorder(_BRD_EMPTY5);
    }

    static public void s_setEmptyLightLowered2(JPanel pnl)
    {

        Border brdCompound = new CompoundBorder(_BRD_LIGHT_LOWERED, _BRD_EMPTY2);
	    pnl.setBorder(brdCompound);
    }

    static public void s_setEmptyLightLowered0(JPanel pnl)
    {

        Border brdCompound = new CompoundBorder(_BRD_LIGHT_LOWERED, _BRD_EMPTY0);
	    pnl.setBorder(brdCompound);
    }

    static public void s_setEmptyLightLowered5(JPanel pnl)
    {
        Border brdCompound = new CompoundBorder(_BRD_LIGHT_LOWERED, _BRD_EMPTY5);
	    pnl.setBorder(brdCompound);
    }
// --------------------
    // FINAL STATIC PRIVATE

    final static private Border _BRD_EMPTY5 = new EmptyBorder(5,5,5,5);
    final static private Border _BRD_EMPTY0 = new EmptyBorder(0, 0, 0, 0);
    final static private Border _BRD_EMPTY2 = new EmptyBorder(2, 2, 2, 2);
    final static private Border _BRD_ETCHED = new EtchedBorder();

    final static private Border _BRD_LIGHT_LOWERED = new BevelBorder(BevelBorder.LOWERED,
        Color.white, Color.gray);

    final static private Font _FNT_TITLE = new Font("Dialog", Font.BOLD, 12);
    final static private Font _FNT_TITLE_LEVEL2 = new Font("Dialog", Font.ITALIC, 12);

}

